package com.icez.base_compose_framework

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import dagger.hilt.android.AndroidEntryPoint
import com.google.accompanist.adaptive.calculateDisplayFeatures
import com.icez.base_compose_framework.theme.BTheme
import com.icez.base_compose_framework.ui.home.HomeScreen
import com.icez.base_compose_framework.ui.home.HomeScreenRoute

@AndroidEntryPoint
class MainActivity : BaseComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //启动边缘到边缘显示效果
        enableEdgeToEdge()
        setContent {
            //计算当前设备的显示特性
            val displayFeatures = calculateDisplayFeatures(this)
           BTheme{
               BaseApp(displayFeature = displayFeatures) {
                   NavHost(navController = it.navHostController, startDestination = HomeScreenRoute.Home.route){
                     composable(HomeScreenRoute.Home.route){
                         HomeScreen()
                     }
                   }
               }
           }
        }
    }
}

